---@class Battle.Skill10023001:Battle.SkillScriptBase
---5只幽灵狼形影不离会一同步入战场
local Skill10023001 = Battle.CreateClass("Skill10023001", Battle.SkillScriptBase)
Battle.Skill10023001 = Skill10023001

function Skill10023001:OnCreate()
    --创建4个
    local defender = self.skill.actor;
    local cfg = DataTable.GetById("t_hero", defender.modelId)
    local scriptParameter = self.skill.skillData.f_ScriptParameter
    defender:SetGroup(defender.id)
    for i = 1, scriptParameter[1] do
        math.randomseed(i * os.time());
        local modelId = defender.modelId
        local x = defender:GetPos().x + math.random(0, 100) / 100 - 0.1
        local y = defender:GetPos().z + math.random(0, 100) / 100 - 0.1
        local dirX = defender.forward.x
        local dirY = defender.forward.y
        local dirZ = defender.forward.z
        local camp = defender.camp
        local param = {};
        param.equipSkillList = { cfg.f_ArtID,cfg.f_SkillID,cfg.f_Characteristic }
        for k,v in pairs( param.equipSkillList) do
            if v == self.skill.skillId then
                table.remove(param.equipSkillList,k)
                break
            end
        end
        local newEntity = Battle.EntityFactory.CreateHero(modelId, camp, x, 0, y, dirX, dirY, dirZ, param)
        newEntity.skillSystem:UnEquipSkill(self.skill.skillId)
        newEntity.attrSystem:SetBaseAttr(Battle.AttributeType.HP, newEntity.attrSystem:GetBaseAttr(Battle.AttributeType.HP) / 2)
        newEntity:SetGroup(defender.id)
    end
end

return Skill10023001


